Operator Precedence
Just as it does in mathematics, operator precedence in VectorScript controls the order in which operations are performed. Operators having a higher precedence have their operations performed before those having a lower precedence. In the expression
p = q + r * s;
the multiplication operator ( * ) has higher precedence than the addition operator, so the multiplication operation is performed before the addition. The assignment operator ( = ) has the lowest precedence of all the operators, so the association, or assignment, of the value to the variable p occurs only after the other operations are completed.
Operator precedence can be overridden by the explicit use of parentheses. To force the addition operation to be performed first in the prior example, parentheses would be used to modify the expression to be:
p = (q + r) * s;
In everyday use, it is good practice to use parentheses if you are unsure about precedence in order to make the evaluation order explicit.

Expressions : Operator Precedence

Nemetschek NA
Phone: 410.290.5114
Fax: 410.290.8050